package com.moefor.clover.model;

import java.util.Date;

import javax.persistence.*;

import com.moefor.clover.model.enums.StateOfOrder;

@Entity
@Table(name = "[order]")
public class Order extends BaseEntity{
	@JoinColumn(nullable = false)
	@ManyToOne(cascade = {CascadeType.ALL})
	private User customer;
	
	@JoinColumn(nullable = false)
	@ManyToOne(cascade = {CascadeType.ALL})
	private Goods goods;
	
	@Column(columnDefinition = "decimal(13, 2) default 0.00")
	private Float price;
	
	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	
	@Column(nullable = false)
	public Date date;
	
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	@Column(nullable = false)
	private String remarks;
	
	@Column(nullable = false)
	@Enumerated(EnumType.ORDINAL)
	private StateOfOrder state;

	public StateOfOrder getState() {
		return state;
	}

	public void setState(StateOfOrder state) {
		this.state = state;
	}

	public User getCustomer() {
		return customer;
	}

	public void setCustomer(User customer) {
		this.customer = customer;
	}

	public Goods getGoods() {
		return goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}

	public Float getPrice() {
		return price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}
}